=========================================================================== BBS: The Abacus * HST/DS * Potterville MI Date: 03-28-93 (19:13) Number: 96 From: BOB PERKINS Refer#: NONE To: SEAN SULLIVAN Recvd: NO Subj: Re: Need a routine Conf: (35) Quick Basi --------------------------------------------------------------------------- SS> I know I've seen a routine for determining the directory SS> from which a program was launched, but can't remember SS> where. Anyone have this info? '$INCLUDE: 'qb.bi' DECLARE FUNCTION ExecPath$ () PRINT ExecPath$ FUNCTION ExecPath$ DIM regs AS regtype regs.ax = &H6200 interrupt &H21, regs, regs DEF SEG = regs.bx DEF SEG = PEEK(44) + PEEK(45) * 256 byte% = 0 DO IF PEEK(byte%) = 0 THEN IF PEEK(byte% + 1) = 0 THEN byte% = byte% + 2: EXIT DO END IF byte% = byte% + 1 LOOP IF PEEK(byte%) = 1 THEN byte% = byte% + 2 DO WHILE PEEK(byte%) temp$ = temp$ + CHR$(PEEK(byte%)) byte% = byte% + 1 LOOP ExecPath$ = temp$ END IF DEF SEG END FUNCTION --- Msg V4.5 * Origin: Reciprocity Failure (1:124/4115.236) SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1 SEEN-BY: 153/752 154/40 77 157/2 159/100 125 430 950 203/23 209/209 280/1 SEEN-BY: 390/1 396/1 15 397/2 2230/100 3603/20